package mylab.demo.usm.biz.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import mylab.annotation.rds.ColumnComment;
import mylab.commons.web.mvc.entity.BaseLinkEntity;
import mylab.starters.mybatis.interceptor.impl.foreignKey.ForeignKey;

/**
 * <p>
 * 角色和资源关联表
 * </p>
 */
@Getter
@Setter
@ApiModel("角色和资源关联表")
@TableName(autoResultMap = true)
public class SysRoleResourceLink extends BaseLinkEntity<SysRole, SysResource> {

    @ForeignKey(SysRole.class)
    @ColumnComment("角色id")
    @ApiModelProperty(value = "角色id")
    @TableField
    private String roleId;

    @ForeignKey(SysResource.class)
    @ColumnComment("资源id")
    @ApiModelProperty(value = "资源id")
    @TableField
    private String resourceId;

    @Override
    protected String getLeftId() {
        return roleId;
    }

    @Override
    protected String getRightId() {
        return resourceId;
    }
}
